#e
#Title[䕄u`c`v]
#Text[]
#ScriptVersion[2]
script_enemy_main
{
	let cx=GetCenterX();//STGV[̒SxW擾
	let cy=GetCenterY();//STGV[̒SyW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,8);
		SetMovePosition02(cx,cy-120,60);
		SetTimer(60);
		SetGraphicRect(1,1,64,64);
		SetInvincibility(60);
		LoadGraphic(imgExRumia);
		SetTexture(imgExRumia);	
		shottask;
		CutIn(YOUMU,"䕄u`c`v",0,0,0,0,0);//XyJ[h\
	}
	@MainLoop
	{
		yield;
		SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
	}
	@Finalize
	{
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	@DrawLoop
	{
		SetGraphicRect(1,1,64,64);
		SetAlpha(255);
		DrawGraphic(GetX(),GetY());
	}
	task shottask
	{
		let s=0;
		loop
		{
			wait(120);
				Concentration01(60);
			wait(60);
				let po=GetY+100;
				loop(20)
				{
					shot(s,GetX-100,po);
					po-=10;
				}
				let po=GetY-100;
				loop(20)
				{
					shot(s,GetX,po);
					po+=10;
				}
				let po=GetY-100;
				loop(20)
				{
					shot(s,GetX+100,po);
					po+=10;
				}
				let po=GetX-100;
				loop(20)
				{
					shot(s,po,GetY-100);
					po+=10;
				}
				let po=GetX+100;
				loop(20)
				{
					shot(s,po,GetY+100);
					po-=10;
				}
				let po=GetX+100;
				loop(20)
				{
					shot(s,po,GetY);
					po-=10;
				}
		}
	}
	function shot(let shotid,let shotx,let shoty)
	{
		let gp =GetAngleToPlayer;
		CreateShotA(shotid,shotx,shoty,10);
		SetShotDirectionType(SEQUENCE);
		SetShotDataA(shotid,0,0,0,0,0,2,16);
		SetShotDataA(shotid,120,rand(0.5,1.5),rand(gp-60,gp+60),0.1,0,2,16);
		FireShot(shotid);
	}
	function wait(w) 
	{
		loop(w)
		{
			yield;
		}
	}
}